# Django基础镜像
FROM python:3.10-alpine
ENV PYTHONUNBUFFERED 1

RUN set -ex && \
    sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
    apk update && \
    apk add -U tzdata && \
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    #apk add --no-cache gcc g++ make

RUN set -ex && \
    mkdir ~/.pip && \
    { \
      echo '[global]'; \
      echo 'index-url = https://pypi.tuna.tsinghua.edu.cn/simple'; \
    } | tee ~/.pip/pip.conf

ADD requirements.txt /

RUN pip install -r /requirements.txt && \
    #pip install ipython && \
    #pip install TA-Lib && \
    mkdir -p /app
WORKDIR /app

EXPOSE 8000
#CMD python manage.py runserver 0.0.0.0:8000
CMD uvicorn main:app --host=0.0.0.0 --port=8000 --reload
